from .views import *
from django.urls import path
from rest_framework.routers import DefaultRouter,SimpleRouter  # 默认路由器

urlpatterns = []

# 创建路由器
router = DefaultRouter()
# 注册路由器
router.register('classifications',ClassificationViewSet)
router.register('commoditys',CommodityViewSet)
router.register('cart',ShoppingCartViewSet,basename='shoppingcart')
router.register('order',OrderViewSet,basename='order')
router.register('payments',PaymentViewSet,basename='payment')
# 路由添加至urlpatterns列表当中
urlpatterns += router.urls
